require(['swiper', 'common'], function (Swiper,Clipboard) {
  // 复制
  var clipboard = new Clipboard('.social-promotion-con .copy-con', {
    target: function() {
      return document.querySelector('.social-promotion-con .con-body');
    }
  });
  clipboard.on('success', function(e) {
    $.toast({text: '复制成功'});
  });
  // 展开
  $(".social-promotion-con .con-foot span").on("click", function () {
    var con = $('.social-promotion-con .con-body'),
      icon = $(this).find("use");
    if(con.hasClass("autoH")){
      con.removeClass("autoH");
      icon.attr("xlink:href","#icon-arrow-down");
    } else {
      con.addClass("autoH");
      icon.attr("xlink:href","#icon-arrow-up");
    }
  });
  // 查看大图
  $(".social-promotion-img li").on("click", function () {
    var url = $(this).css("background-image").split("\"")[1];
    var photo = $('<div class="photo-browser"><div class="photo-browser-mask"></div><img src="'+url+'"></div>').appendTo(document.body);
    photo.show().addClass("show");
    $(".photo-browser-mask",photo).on("click", function () {
      photo.hidePopup()
    })
  });
});
